export const MapWatchState=(state)=>{
    const res={};
    if(typeof state==='function'){
      state=state();
    }
  if(state&&state.constructor===Array){
    state.map((item)=>{
      res[item['state']]={
        handler(curVal, oldVal) {
          let funcEven=item['even'];
          let even;
          if(funcEven&&typeof funcEven==='function'){
            even=item['even'].apply(this);
          }
        //   this.messageAlert(curVal,item['message'],even);
          this.AutoMessage({state:curVal,message:item['message'],even:even,error:item['error']})
        },
        deep: true
      }
    })
  }
    return res
  }